﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true"
    CodeFile="CreateEmployee.aspx.cs" Inherits="Employees_CreateEmployee" Title="Нов служител" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h2 style="border-bottom: solid 1px black">
        <asp:Image ID="imgUsers" runat="server" Width="15" Height="15" ImageUrl="~/images/Profile.png" />&nbsp;&nbsp;Нов
        служител</h2>
    <asp:DetailsView ID="dvEmployee" runat="server" Height="50px" Width="450px" AutoGenerateRows="False"
        DataKeyNames="EmployeeID" DataSourceID="ldsEmployee" DefaultMode="Insert" OnItemInserted="dvEmployee_ItemInserted">
        <HeaderStyle BackColor="#99CCFF" />
        <HeaderTemplate>
            <label style="float: left;" class="insert_label">
                <b>Данни за служителя</b></label><asp:ImageButton ID="ibtnClose" Style="float: right;"
                    ImageUrl="~/images/Delete.png" ToolTip="Затвори" Width="20" runat="server" CausesValidation="false"
                    OnClick="ibtnClose_Click" />
        </HeaderTemplate>
        <Fields>
            <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" ReadOnly="True" SortExpression="EmployeeID"
                Visible="False" />
            <asp:TemplateField HeaderText="Име" SortExpression="FirstName">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbFirstName" MaxLength="50" CssClass="insert_input" runat="server"
                        Text='<%# Bind("FirstName") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvFirstName" ControlToValidate="tbFirstName" ErrorMessage="Моля въведете име!"
                        ToolTip="Моля въведете име!" runat="server">*</asp:RequiredFieldValidator>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Презиме" SortExpression="MiddleName">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbMiddleName" MaxLength="50" CssClass="insert_input" runat="server"
                        Text='<%# Bind("MiddleName") %>'></asp:TextBox>
                    <%--<asp:RequiredFieldValidator ID="rfvMiddleName" ControlToValidate="tbMiddleName" ErrorMessage="Моля въведете презиме!"
                        ToolTip="Моля въведете презиме!" runat="server">*</asp:RequiredFieldValidator>--%>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Фамилия" SortExpression="LastName">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbLastName" MaxLength="50" CssClass="insert_input" runat="server"
                        Text='<%# Bind("LastName") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvLastName" ControlToValidate="tbLastName" ErrorMessage="Моля въведете фамилия!"
                        ToolTip="Моля въведете фамилия!" runat="server">*</asp:RequiredFieldValidator>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Email" SortExpression="Email">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbEmail" MaxLength="256" CssClass="insert_input" runat="server"
                        Text='<%# Bind("Email") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvEmail" ControlToValidate="tbEmail" Display="Dynamic"
                        ErrorMessage="Моля въведете email!" ToolTip="Моля въведете email!" runat="server">*</asp:RequiredFieldValidator><asp:RegularExpressionValidator
                            ID="revEmail" runat="server" ControlToValidate="tbEmail" Display="Dynamic" ErrorMessage="Email полето е попълнено неправилно!"
                            ToolTip="Email полето е попълнено неправилно!" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Длъжност" SortExpression="JobTitle">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbJobTitle" MaxLength="50" CssClass="insert_input" runat="server"
                        Text='<%# Bind("JobTitle") %>'></asp:TextBox>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Телефон" SortExpression="BusinessPhone">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbPhone" MaxLength="20" CssClass="insert_input" runat="server" Text='<%# Bind("BusinessPhone") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvPhone" ControlToValidate="tbPhone" ErrorMessage="Моля въведете телефон!"
                        ToolTip="Моля въведете телефон!" runat="server">*</asp:RequiredFieldValidator>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Домашен тел." SortExpression="HomePhone">
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox1" CssClass="insert_input" MaxLength="20" runat="server"
                        Text='<%# Bind("HomePhone") %>'></asp:TextBox>
                </InsertItemTemplate>
                <HeaderStyle CssClass="insert_label" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Факс" SortExpression="FaxNumber">
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox2" CssClass="insert_input" runat="server" MaxLength="20"
                        Text='<%# Bind("FaxNumber") %>'></asp:TextBox>
                </InsertItemTemplate>
                <HeaderStyle CssClass="insert_label" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Адрес" ControlStyle-CssClass="insert_input" SortExpression="Address">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbAddress" runat="server" CssClass="insert_input" MaxLength="100"
                        Text='<%# Bind("Address") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvAddress" ControlToValidate="tbAddress" ErrorMessage="Моля въведете адрес!"
                        ToolTip="Моля въведете адрес!" runat="server">*</asp:RequiredFieldValidator>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Град" SortExpression="City">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbCity" MaxLength="50" CssClass="insert_input" runat="server" Text='<%# Bind("City") %>'></asp:TextBox>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Щат/Провинция" SortExpression="StateProvince">
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox4" runat="server" MaxLength="50" CssClass="insert_input"
                        Text='<%# Bind("StateProvince") %>'></asp:TextBox>
                </InsertItemTemplate>
                <HeaderStyle CssClass="insert_label" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Пощенски код" SortExpression="PostalCode">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbPostalCode" CssClass="insert_input" MaxLength="10" runat="server" Text='<%# Bind("PostalCode") %>'></asp:TextBox>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Уебсайт" SortExpression="Website">
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" MaxLength="200" CssClass="insert_input" Text='<%# Bind("Website") %>'></asp:TextBox>
                </InsertItemTemplate>
                <HeaderStyle CssClass="insert_label" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Допълнителни бележки" SortExpression="Notes">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:TextBox ID="tbNotes" CssClass="insert_input" MaxLength="300" TextMode="MultiLine" runat="server"
                        Text='<%# Bind("Notes") %>'></asp:TextBox>
                </InsertItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <HeaderStyle CssClass="insert_label" />
                <InsertItemTemplate>
                    <asp:LinkButton ID="LinkButton1" CssClass="link" runat="server" CausesValidation="True"
                        CommandName="Insert" Text="Запис"></asp:LinkButton>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" CssClass="link" runat="server" CausesValidation="False"
                        CommandName="New" Text="New"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Fields>
        <FieldHeaderStyle Wrap="False" />
    </asp:DetailsView>
    <asp:LinqDataSource ID="ldsEmployee" runat="server" ContextTypeName="EmployeeData.EmployeeDataClassesDataContext"
        TableName="Employees" EnableInsert="True">
    </asp:LinqDataSource>
</asp:Content>
